<?php
/* @var $this ProjectController */
/* @var $model Project */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'project-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'project_name'); ?>
		<?php echo $form->textField($model,'project_name',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'project_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'lead_man'); ?>
		<?php echo $form->textField($model,'point_person',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'point_person'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'start_date'); ?>
		<?php $form->widget('zii.widgets.jui.CJuiDatePicker', array(
    'model' => $model,
    'attribute' => 'start_date',
    'options' => array(
        'showAnim' => 'fold',
        'dateFormat' => 'yy-mm-dd',
    ),
    'htmlOptions' => array(
        'style' => 'height:20px;',
        'size' => '12',
    ),
)); ?>
		<?php echo $form->error($model,'start_date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'end_date'); ?>
				<?php $form->widget('zii.widgets.jui.CJuiDatePicker', array(
    'model' => $model,
    'attribute' => 'end_date',
    'options' => array(
        'showAnim' => 'fold',
        'dateFormat' => 'yy-mm-dd',
    ),
    'htmlOptions' => array(
        'style' => 'height:20px;',
        'size' => '12',
    ),
)); ?>
		<?php echo $form->error($model,'end_date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'total_project_cost'); ?>
		<?php echo $form->textField($model,'total_cost'); ?>
		<?php echo $form->error($model,'total_cost'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'total_expenses'); ?>
		<?php echo $form->textField($model,'total_expenses'); ?>
		<?php echo $form->error($model,'total_expenses'); ?>
	</div>

	 <div class="row">
        <?php 
                $criteria = new CDbCriteria();
                $criteria->select = 'id';
                $criteria->condition = 'username=:name';
                $criteria->params = array(':name'=>Yii::app()->user->name);
        ?>
		
                <!-- <?php echo $form->labelEx($model,'User_id'); ?> !-->
                <?php echo $form->dropDownList($model, 'user_id', CHtml::listData(User::model()->findAll('username = :a', array(':a'=>Yii::app()->user->name)), 'id', 'fname'), array('style' => 'display:none')); ?>
                <?php echo $form->error($model,'User_id'); ?> 
        </div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->